const a = function (
  { row: { FILEPATH, FILENAME } },
  _,
  { constant },
  { dc: { open, preview } }
) {
  const prefix = constant?.upload?.down?.prefix ?? ["http://s3.idea"];
  const url = prefix.reduce(
    (prev, search) => prev.replace(search, ""),
    FILEPATH
  );
  const suffix = url.substr(url.lastIndexOf(".") + 1).toLowerCase();
  const imgSuffix = ["png", "jpeg", "jpg", "gif", "bmp", "webp", "svg"];
  if (imgSuffix.indexOf(suffix) > -1) return preview({ imageList: [url] });
  const modal = {
    defaultFullscreen: true,
    open: true,
    canFullscreen: false,
    showOkBtn: false,
    showCancelBtn: false,
    wrapClassName: "no-footer",
    title: FILENAME,
  };
  open({
    layout: { id: "pPreview" },
    modal,
    transfer: { url, fileName: FILENAME },
  });
};
const a1 = function ({ row: { FILEPATH, FILENAME } }, _, _1, { dc: { http } }) {
  const url = FILEPATH.startsWith("http://s3.idea")
    ? FILEPATH.replace("http://s3.idea", "")
    : FILEPATH;
  http.download({ url }, FILENAME, { withToken: false });
};
